﻿namespace RanbuOM.Serialization
{
    public abstract class DataTypeBase
    {
        internal long Position { get; set; }

        internal virtual void ReadFrom(RanbuReader reader, string group)
        {
            if (group == null)
            {
                this.Position = reader.Position;
            }

            reader.ReadDataProperties(this, group);
        }

        internal virtual void WriteTo(RanbuWriter writer, string group)
        {
            if (group == null)
            {
                this.Position = writer.Position;
            }

            writer.WriteDataProperties(this, group);
        }
    }
}
